package com.wonder.media;

import android.content.Context;
import android.os.PowerManager;

public class PlayerFactory {
	/**
	 * {@literal description: 鑾峰緱鎾斁鍣ㄧ殑瀹炰緥}
	 * 
	 * @param context
	 *            浼犺緭涓�釜Activity鐨勫疄渚嬪嵆鍙�
	 * @param overlayUsed
	 *            鏄惁浣跨敤纭欢鏄剧ずvideo锛屽拰纭欢骞冲彴鐩稿叧锛岄渶瑕侀�閰�
	 * @param overlayFormat
	 *            纭欢骞冲彴overlay鐨刦ormat锛岄渶瑕侀�閰�
	 * @return 
	 * @see 璋冪敤璇ュ嚱鏁拌幏寰椾竴涓猵layer鐨勫疄渚�
	 */
		
	public static Player getPlayerInstance(Context context, 
			String workspace, boolean overlayUsed,
			int overlayFormat, boolean usedefault){
		
		if (null != context) { // 鐢垫簮绠＄悊鍔熻兘鐨勯澶勭悊
			PowerManager mPowerManager = (PowerManager) context
					.getSystemService(Context.POWER_SERVICE);
			mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK,
					"BackLight");
		}
		if(usedefault == true)
			return DefaultPlayer.getInstance(workspace, overlayUsed, overlayFormat);
		else
			return WonderPlayer.getInstance(workspace, overlayUsed, overlayFormat);
	}
}
